const baseUrl2 = "https://myr.wissun.net"
const uploadfile=function(url,data,success,fail,complete,method,nouid){
    var token = uni.getStorage("fahuo_jxs_token");
    uni.showNavigationBarLoading();
	console.log("data",data)
    method=method=='post' || method=='POST' ? 'POST' : 'GET';
    uni.uploadFile({
        url:baseUrl2+url,
        method:method,
        filePath: data,
        name: 'image',
        header:{
            'content-type': 'multipart/form-data',
            'token':token
        },
        success:function(res){
			console.log(res)
            var ret=res.data;
            
            let code=parseInt(ret.state);
            if(code==200){
                'function'==typeof success && success(ret);
            }else if(code==400){
                uni.hideLoading()
            }
        }
    })
 }
 
 export default uploadfile